﻿using System.Web;

namespace _5E.NHibernateRepository.SessionStorage
{
    public class SessionStorageFactory
    {
        private static ISessionStorageContainer s_SessionStorageContainer = null;
        public static ISessionStorageContainer SessionStorageContainer
        {
            get
            {
                if (null == s_SessionStorageContainer)
                {
                    if (null == HttpContext.Current)
                        s_SessionStorageContainer = new ThreadSessionStorageContainer();
                    else
                        s_SessionStorageContainer = new HttpSessionContainer();
                }
                return s_SessionStorageContainer;
            }
        }
    }
}
